class Person(object):
    def __init__(self, name, age):
        self.name = name
        self.age = age

    def __str__(self):
        """
        返回的是一个字符串
        :return:
        """
        _str = 'name' + ' ' + self.name + ', ' + 'age' + ' ' + str(self.age)
        return _str

    def __del__(self):
        del self.name
        del self.age


if __name__ == '__main__':
    lzk = Person('lizikun', 23)
    # 在释放某个对象的空间时会触发__del__方法
    del lzk
